import 'package:xlsk/api/index.dart';

class IndexApi {
  factory IndexApi(){
    final _instance = IndexApi._();
    return _instance;
  }
  IndexApi._();

  getKecheng(context,path) async{
    var res = await Request(context).post(path);
    var code = res['code'] is String?num.parse(res['code']):res['code'];
    res['code'] = code;
    return res;
  }

  getTongzhi(context,path,data) async{
    var res = await Request(context).post(path,data);
    var code = res['code'] is String?num.parse(res['code']):res['code'];
    var result = [];
    if(code == 200){
      result = res['data'];
    }
    return result;
  }
}